package com.doule.farmerassistant.autoupdate;

import android.content.Context;
import android.content.pm.PackageManager;

/**
 * Created by Happy on 2015/1/27.
 */
public class ApkVersion {
    public static String getCurrentPackageName(Context c) {
        return c.getPackageName();
    }

    public static int getCurrentApkVersionCode(Context c) {
        int versionCode = 0;
        try {
            versionCode = c.getPackageManager().getPackageInfo(c.getPackageName(), 0).versionCode;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }

        return versionCode;
    }
}
